package com.jyh.blog.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* 上传模式
*/
@Getter
@AllArgsConstructor
public enum UploadModeEnum {
    OSS("oss","ossUploadStrategyImpl"),
    LOCAL("local","localUploadStrategyImpl");

    private final String mode;
    private final String strategy;

    public static String getStrategy(String mode){
        for (UploadModeEnum value  : UploadModeEnum.values()) {
            if(value.getMode().equals(mode)){
                return value.getStrategy();
            }
        }
        return null;
    }
}
